package com.sdy.supermarket.biz.mapper;

import com.sdy.supermarket.biz.model.GsOrderItem;
import com.sdy.mvc.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 申请单-资源关联表 Mapper 接口
 * </p>
 *
 * @author zzq
 * @since 2019-07-16
 */
public interface GsOrderItemMapper extends BaseMapper<GsOrderItem> {

    /**
     * 获取需要发送的订单信息和资源ID
     *
     * @return
     */
    @Select("select i.id,i.order_item_no,i.user_id,i.res_id from gs_order_item i\n" +
            "where i.type=1\n" +
            "and i.state=2")
    List<Map<String, Object>> getSendApprovalInfo();

    /**
     * 对订单列表进行批量更新
     *
     * @param list
     * @return
     */
    int batchUpdate(List<GsOrderItem> list);

}
